import cv2
import math

# 时分秒
hour = 9
minute = 24
second = 11
# 100 x 100
img = cv2.imread("./img/base.png")

cv2.circle(img,(50,50),50,color=(0,0,0),thickness=2)
# 秒针
second_degree = second / 60 * (2 * math.pi)
second_radius = 40
x = int(math.sin(second_degree) * second_radius + 50)
y = int(50 - math.cos(second_degree) * second_radius)
cv2.line(img,(50,50),(x,y),color=(0,0,255),thickness=4)
# 分针
minute_degree = minute / 60 * (2 * math.pi)
minute_radius = 30
x = int(math.sin(minute_degree) * minute_radius + 50)
y = int(50 - math.cos(minute_degree) * minute_radius)
cv2.line(img,(50,50),(x,y),color=(0,255,0),thickness=4)
# 时针
hour_degree = hour / 12 * (2 * math.pi)
hour_radius = 20
x = int(math.sin(hour_degree) * hour_radius + 50)
y = int(50 - math.cos(hour_degree) * hour_radius)
cv2.line(img,(50,50),(x,y),color=(255,0,0),thickness=4)

cv2.imshow("img",img)
cv2.waitKey(0)